package com.googlecode.spreadit.bean;

import java.io.Serializable;

/**
 * A {@link SpreadReceiver} encapsulates a contact that should receive a
 * forwarded message. The {@link SpreadReceiver} contains the receiver's contact
 * information and the respective {@link SpreadChannel channel}.
 * 
 * @author Markus L. Dechert (markus.dechert@googlemail.com)
 */
public class SpreadReceiver implements Serializable {

	/**
	 * Generated serialization ID.
	 */
	private static final long serialVersionUID = -1194057448245848920L;

	private String name;
	private String contactInformation;
	private SpreadChannel targetChannel;

	public SpreadReceiver() {
	}

	public SpreadReceiver(String name, String contactInformation,
			SpreadChannel targetChannel) {
		this.name = name;
		this.contactInformation = contactInformation;
		this.targetChannel = targetChannel;
	}

	public SpreadChannel getTargetChannel() {
		return targetChannel;
	}

	public void setTargetChannel(SpreadChannel targetChannel) {
		this.targetChannel = targetChannel;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContactInformation() {
		return contactInformation;
	}

	public void setContactInformation(String contactInformation) {
		this.contactInformation = contactInformation;
	}

	@Override
	public String toString() {
		return getName() + " (" + getTargetChannel() + ")";
	}
}
